package com.wdc.list_;

import java.util.LinkedList;
import java.util.Stack;
import java.util.function.Consumer;

public class LinkedListDemo {
    public static void main(String[] args) {
        LinkedList<Integer> stack = new LinkedList<>();

        stack.addFirst(1);
        stack.addFirst(2);
        stack.addFirst(3);
        stack.addFirst(4);
        stack.addFirst(5);

        stack.forEach(item->{
            System.out.println(item);
        });

        System.out.println("弹出栈顶元素 = "+stack.poll());

//        Stack<Integer> stack = new Stack<>();
//        stack.push(1);

    }

}
